﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace The_Eye
{
    public partial class QuestionForm : Form
    {
        mainForm mnForm = null;
        public QuestionForm()
        {
            InitializeComponent();
        }

        public QuestionForm(string strLabel, string strProblem, string strQuestion, 
                            bool enableButtonCancel, bool enableButtonAddToDb,mainForm form)
        {
            InitializeComponent();
            this.Text = strLabel;
            lblProblem.Text = strProblem;
            lblQuestion.Text = strQuestion;
            btnCancel.Enabled = enableButtonCancel;
            btnAdd.Enabled = enableButtonAddToDb;
            lblProblem.Left = this.Width/2 - lblProblem.Width/2;
            lblQuestion.Left = this.Width / 2 - lblProblem.Width / 2;
            mnForm = form;
            
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            Close();
            mnForm.setEnabledOfFormElements(true);
            mainForm.ActiveForm.Activate();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
